# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname=fceux
pkgver=2.2.3
pkgrel=0
pkgdesc="Fast and ultra-compatible NES/Famicom emulator"
url="http://www.fceux.com"
arch=""
license="GPL-2.0-only"
depends_dev="sdl-dev gd-dev gtk+2.0-dev mesa-dev glu-dev"
makedepends="$depends_dev scons"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/project/fceultra/Source%20Code/$pkgver%20src/$pkgname-$pkgver.src.tar.gz
	scons-python3.patch"
options="!check" # no testsuite

build() {
	scons -C "$pkgname-$pkgver"
}

package() {
	scons install -i --prefix="$pkgdir/usr"

	install -d "$pkgdir/usr/share/doc/$pkgname"
	cp -r documentation/* "$pkgdir/usr/share/doc/$pkgname/"
	install -Dm644 changelog.txt "$pkgdir/usr/share/doc/$pkgname/"

	# desktop shortcut
	install -Dm644 "$pkgname.desktop" \
		"$pkgdir/usr/share/applications/$pkgname.desktop"
	install -Dm644 "$pkgname.png" \
		"$pkgdir/usr/share/pixmaps/$pkgname.png"

	rm -f "$pkgdir/usr/share/$pkgname/"*.dll
}

sha512sums="6deb83e9e773694f4040f5f325b0b5b4f45d58bb3481db67b4659c940d90c4c87e3ffeac712b72ddb3f5d089cd9fc7b55b497db61f708c23a7c43c17eda55c7b  fceux-2.2.3.src.tar.gz
2c2cf6d7eac03a4cf7f66118e0f8af9562eb5497c2e3159952eced1edee5f38c983ede704536eade645f5c028635b8ff0ceca8769dcf0d50b3159a1666660ae0  scons-python3.patch"
